package com.team.controller;

import com.team.service.ManaginePrivilegesService;
import com.team.vo.CountPrice;
import com.team.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author keluoyisi
 * @program: seven
 * @description: 二级菜单排版管理控制层实现
 * @date 2022-10-14 10:20:50
 */
@Controller
@ResponseBody
@RequestMapping("/ManaginePrivilegesController")
public class ManaginePrivilegesController {
    @Autowired
    private ManaginePrivilegesService managinePrivilegesService;

    /**
     * @param :
     * @return Result
     * @description 显示所有部门以及对应的科室
     */
    @RequestMapping("/selectDeptSection")
    public Result selectDeptSection(){
        return managinePrivilegesService.selectDeptSection();
    }

    /**
     * @param :
     * @return Result
     * @description 根据科室id查询可是对应的所有医生 医生的排班的详细信息（价格，时间，预约数）
     */
    @RequestMapping("/selectSectionDoctors")
    public Result selectSectionDoctors(){
        return managinePrivilegesService.selectSectionDoctors();
    }

    /**
     * @param :
     * @return Result
     * @description 根据科室id查询可是对应的所有医生 医生的排班的详细信息（价格，时间，预约数）
     */
    @RequestMapping("/selectSectionDoctors2")
    public Result selectSectionDoctors2(){
        return managinePrivilegesService.selectSectionDoctors2();
    }

    /**
     * @param :
     * @return Result
     * @description  直接获取的时间—日期（yyyy-MM-dd）连续的7天
     */
    @RequestMapping("/getCurrentTimes")
    public Result getCurrentTimes(){
        List<String> currentTimes = managinePrivilegesService.getCurrentTimes();
        return new Result(200,"获取时间成功",currentTimes);
    }

    /**
     * @param :
     * @return Result
     * @description 得到科室的id并且存在session中
     */
    @RequestMapping("/addSectionId")
    public Result addSectionId(int id){
        return managinePrivilegesService.addSectionId(id);
    }

    /**
     * @param account:
     * @param date:
     * @return Result
     * @description  用来保存医生的id和时间到session中
     */
    @RequestMapping("/idDate")
    public Result idDate(String account,String date){
        return managinePrivilegesService.idDate(account,date);
    }

    /**
     * @param countPrice:
     * @return Result
     * @description 添加排班
     */
    @RequestMapping("/addduty")
    public Result addduty(@RequestBody CountPrice countPrice){
        return managinePrivilegesService.addduty(countPrice);
    }
}
